package com.fundcrawler.repository;

import com.fundcrawler.entity.BizParam;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface BizParamRepository extends JpaRepository<BizParam, Integer> {

    @Query("SELECT f FROM BizParam f WHERE f.paramCode = :paramCode and f.paramGroup=:paramGroup")
    BizParam findByParamCodeGroup(@Param("paramCode") String paramCode, @Param("paramGroup") String paramGroup);

    @Query("SELECT f FROM BizParam f WHERE f.paramCode = :paramCode")
    List<BizParam> findAllByParamCode(@Param("paramCode") String paramCode);

}
